/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.lucava.boatskeeper.server.handler.user;

import net.customware.gwt.dispatch.server.ActionHandler;
import net.customware.gwt.dispatch.server.ExecutionContext;
import net.customware.gwt.dispatch.shared.ActionException;
import org.lucava.boatskeeper.server.MockUserDao;
import org.lucava.boatskeeper.shared.rpc.user.GetUsers;
import org.lucava.boatskeeper.shared.rpc.user.GetUsersResult;

/**
 *
 * @author glenn
 */
public class GetUsersHandler implements ActionHandler<GetUsers, GetUsersResult> {

    @Override
    public Class<GetUsers> getActionType() {
        return GetUsers.class;
    }

    @Override
    public GetUsersResult execute(GetUsers a, ExecutionContext ec) throws ActionException {

        GetUsersResult getUsersResult = new GetUsersResult(MockUserDao.getAll());

        return getUsersResult;
    }

    @Override
    public void rollback(GetUsers a, GetUsersResult r, ExecutionContext ec) throws ActionException {
    }
}
